# coding: utf8
'''
	主程序入口
	使用:命令行下输入	python text2voice.py 1 回车
'''

# 斗罗大陆
from novel import dou_luo_da_lu as dldl

# 发声
import voice

# 命令行
import click

@click.command()
@click.argument('opt', default=1)
def say(opt):
	click.echo('正在爬取小说内容...')
	command = ''
	if opt < 0:
		command = 'url_prev'
	elif opt > 0:
		command = 'url_next'
	else:
		command = 'url'
	
	voice.say(dldl.novel_text(command))

if __name__ == '__main__':
	click.echo('-1:上一章, 0:再听一遍, 1:下一章')
	say()